# Table S2: Topic prevalence distributed by question

# Load packages
library(stm)
library(foreign)

# Import data
path <- "P:/2017-pathways/new/4-model-output"
setwd(path)
load("pathwaysPrevFit9.Rdata")

# Topic proportion
treatfreq<-as.data.frame(colSums(pathwaysPrevFit9$theta[meta_o_p_data$treatment==1,])/1040)
names(treatfreq)[1]<-paste("OilGas")
treatfreq$Energy <- colSums(pathwaysPrevFit9$theta[meta_o_p_data$treatment==2,])/964
treatfreq$Transition <- colSums(pathwaysPrevFit9$theta[meta_o_p_data$treatment==3,])/942
treatfreq$Total <- colSums(pathwaysPrevFit9$theta)/2946
treatfreq$Topic<- c(
  "Energy sources", 
  "Alternatives to oil", 
  "Crisis", 
  "End of era", 
  "Work life changes",
  "Lofoten", 
  "Dependence",
  "Fossil-renewable",
  "Political/economic changes")
print(treatfreq, digits=4)